package cn.bocai.pc.web.ws.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.bocai.pc.service.BcPictureService;
import cn.bocai.pc.web.ws.service.ExcuteReaderService;



@Controller
@RequestMapping("/user")
public class ExcuteReaderServiceImpl implements ExcuteReaderService{
	// 注入图片服务
		@Autowired
		BcPictureService bcPictureService;
		
		@Override
		public void returnScanDate(String path, ArrayList<String> findFileName) {

			String temp[] = path.split("\\\\");
			if (temp.length > 1) {
				String parPeriods = temp[temp.length - 1];
				String colours = temp[temp.length - 2];
				String parYears = temp[temp.length - 3];
				// 返回数据处理

				List<String> list = (List<String>) findFileName;
				if (list.size() > 0) {
		        if(1==list.size()){
		        	if("null".equals(list.get(0))){
		        		list.remove(0);
		        	}
		        }
					bcPictureService.scanStorageByThumpic(list, parYears, colours,parPeriods);
				}
			}
		}

}
